/***************************************************************************
 *            sudoku.h
 *
 *  Tue Aug 30 17:57:01 2005
 *  Copyright  2005  Yitzhak Grossman
 *  celejar@gmail.com
 ****************************************************************************/

/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
 
 
/* header file for sudoku generator; borrowed (modified) from solver */
  

/* type definitions */
enum cell_info {YES, NO, MAYBE};
struct sudoku_info
{
	int grid[9][9]; /* cells contain the digit if known, 0 if unknown */
	enum cell_info info[9][9][9]; /* cells contain 1 if cell [a][b] is c, -1 if it isn't, and 0 if unknown */
	/*int solutions; number of solutions found so far */
	int known;
};

/* function prototypes */
int set_cell(struct sudoku_info *sudoku, int i, int j, int value);
void display_grid(struct sudoku_info *sudoku);
int add_cells(struct sudoku_info *sudoku);
int find_cells(struct sudoku_info *sudoku);
int find_rows(struct sudoku_info *sudoku);
int find_columns(struct sudoku_info *sudoku);
int find_grids(struct sudoku_info *sudoku);
int solve(struct sudoku_info *sudoku);
void find_assume(struct sudoku_info *sudoku, int *i, int *j, int *value);
void sud_struct_zero(struct sudoku_info *sudoku);
#define WII
#ifdef WII
void fill(struct sudoku_info *sudoku);
void thin(struct sudoku_info *sudoku);
#endif
	
/* global(s) */
extern int Solutions;
